package com.pigplay.demo.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.pigplay.demo.model.User;

@Controller
@RequestMapping("/user")
public class UserController {
	
	@RequestMapping("/list")
    public String  listUser(Model model) {
        List<User> userList = new ArrayList<User>();
        for (int i = 0; i <10; i++) {
            userList.add(new User(i, "zhangsan" + i, "123456" + i));
        }
        
        model.addAttribute("userList", userList);
        return "list";
    }
}
